<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Http\Requests\UserContext;
use App\Http\Services\OrderService;
use App\Http\Traits\ResponseJson;

class OrderController extends Controller
{
    use ResponseJson;

    protected $orderService;

    public function __construct(OrderService $orderService)
    {
        $this->orderService = $orderService;
    }

    public function lists(UserContext $userContext)
    {
        $data = $this->orderService->lists($userContext);
        return $this->returnJson($data);
    }
    public function createOrder(UserContext $userContext)
    {
        $data = $this->orderService->createOrder($userContext);
        return $this->returnJson($data);
    }

    public function serial()
    {
        $data = $this->orderService->serial();
        return $this->returnJson($data);
    }

    public function statics(UserContext $userContext)
    {
        $data = $this->orderService->statics($userContext);
        return $this->returnJson($data);
    }

    public function createRefundOrder(UserContext $userContext)
    {
        $data = $this->orderService->createRefundOrder($userContext);
        return $this->returnJson($data);
    }

    public function verifyOrder(UserContext $userContext)
    {
        $data = $this->orderService->verifyOrder($userContext);
        return $this->returnJson($data);
    }

    public function singleDragonStatics()
    {
        $data = $this->orderService->singleDragonStatics();
        return $this->returnJson($data);
    }

    public function totalStatics(UserContext $userContext)
    {
        $data = $this->orderService->totalStatics($userContext);
        return $this->returnJson($data);
    }

    public function dragStatics(UserContext $userContext)
    {
        $data = $this->orderService->dragStatics($userContext);
        return $this->returnJson($data);
    }

}
